export default {
  // 分模块后 默认所有的getter、mutations、actions 会与根模块进行合并
  // 所有记得一定要 开启命名空间
  namespaced: true,
  state: {
    // 用户信息
    profile: {
      account: '',
      avatar: '',
      birthday: null,
      cityCode: null,
      gender: null,
      id: '',
      mobile: '',
      nickname: null,
      profession: null,
      provinceCode: null,
      token: ''
    }
  },
  getters: {
    // 快速获取用户名
    getName: state => state.profile.account,
    // 获取token
    getToken: state => state.profile.token
  },
  mutations: {
    setInfo (state, info) {
      state.profile = info
    }
  },
  actions: {
    aaa ({ commit }, info) {
      commit('setInfo', info)
    }
  }
}
